﻿myApp.controller('FooterController', function ($scope, $location, $http) {

    var inputString = window.location.href;
    var findme = "escaped_fragement";
    var findme2 = "ListingEntry";
    if ((inputString.indexOf(findme) > -1) || (inputString.indexOf(findme2) > -1)) {
        console.log("Don't do background get");
        $scope.url = "";
    } else {

        $scope.url = window.location.href + "?_escaped_fragment_=";
        console.log("Try background get");
        $http({
            method: 'GET',
            url: $scope.url
        }).then(function successCallback(response) {
            console.log("Background call Success");
            console.log(response);
        }, function errorCallback(response) {
            console.log("Background call Fail");
            console.log(response);
        });
    }    
    console.log($scope.url);
});